# Generated by Django 4.2.7 on 2023-11-11 02:19

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('articles', '0007_articlescope_is_main'),
    ]

    operations = [
        migrations.CreateModel(
            name='Tags',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='Раздел')),
            ],
        ),
        migrations.CreateModel(
            name='TagsArticle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_main', models.BooleanField(default=False)),
            ],
        ),
        migrations.RemoveField(
            model_name='articlescope',
            name='article',
        ),
        migrations.RemoveField(
            model_name='articlescope',
            name='scope',
        ),
        migrations.AlterModelOptions(
            name='article',
            options={'verbose_name': 'Статья', 'verbose_name_plural': 'Статьи'},
        ),
        migrations.RemoveIndex(
            model_name='article',
            name='articles_ar_publish_c1a2fc_idx',
        ),
        migrations.RemoveField(
            model_name='article',
            name='scopes',
        ),
        migrations.DeleteModel(
            name='ArticleScope',
        ),
        migrations.DeleteModel(
            name='Scope',
        ),
        migrations.AddField(
            model_name='tagsarticle',
            name='article',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='scopes', to='articles.article'),
        ),
        migrations.AddField(
            model_name='tagsarticle',
            name='tag',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='scopes', to='articles.tags'),
        ),
        migrations.AddField(
            model_name='tags',
            name='articles',
            field=models.ManyToManyField(through='articles.TagsArticle', to='articles.article'),
        ),
    ]
